function ResizeImages() {
    var myimg,oldwidth,oldheight;
    var maxwidth = 1170;
    var maxheight = 400;
    var imgs = document.getElementsByClassName('carousel-inner')[0].getElementsByTagName('img');
    for(i=0;i<imgs.length;i++){
        myimg = imgs[i];
        console.log(myimg.height);
        if(myimg.width > maxwidth) {
            oldwidth = myimg.width;
            myimg.height = myimg.height * (maxwidth / oldwidth);
            myimg.width = maxwidth;
        }else {
            if (myimg.height > maxheight){
                oldheight = myimg.height;
                myimg.width = myimg.width * (maxheight/oldheight);
                myimg.height = maxheight;
            }
        }
    }
}
window.onload=ResizeImages();